<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>启动爬虫</title>
    <script src="../static/js/jquery.min.js"></script>

</head>
    <body>
        <form action="/spider" method="post" id="new">
        </form>
        <script>

                //var form1 = document.createElement("form");

                //t.action = "/spider"
                //t.method = "post"
                //form1.id = "city"
                //document.body.appendChild(form1)
                //document.body.appendChild(form1)
                var news = document.getElementById("new");
                $.get('../static/json/city.json' , function (data) {
                    for (var i = 0; i < data.length; i++) {

                        var input = document.createElement("input")
                        input.type = "checkbox"
                        input.value = data[i].url
                        input.name = "url"
                        news.append(data[i].name)
                        news.appendChild(input)

                        news.appendChild(document.createElement("br"))
                    }
                })
                var sub = document.createElement("input")
                sub.type = "submit"
                sub.value = "提交"
                news.appendChild(sub)
            </script>

    </body>
</html>